#ifndef __globaldata_h__
#define __globaldata_h__

#include "networkmgr.h"
#include "ts/Mux.h"
#include "rtsp/rtsp.h"
#include "rtp/rtp.h"
#include "CRtmpPush.h"
#include "SerialPortSrv.h"
#include "irchannel.h"
#include "rtsp_server.h"
#include "wifimgr.h"
extern struct TSPKG_SESSION ts_session;
extern rtp *mrtp;
extern CRtmpPush rtmp;
extern NetWorkMgr *nmgr;
extern WIFIMGR *wmgr;
extern SerialPortU2 *spu2;
extern IRCHANNEL *irchn;
extern RTSPServer *rtspSrv;

struct RUNTIME_STATE
{
	int stream_state;		//流类型 0：停止 1：RTMP 2:RTP
	int storage;			//储存标记，这个是远程是否录像的标志，本地不用这个
	char pushurl[256];		//当前推流地址，当stream_state为0的时候无效
	bool audio_enable;		//是否启动推送音频
	bool video_enable;		//是否推送视频
	int resolution;			//分辨率 0:QVGA 1:VGA 640*480
							//		 2:720P 1280*720   3:1080P 1920*1080
	bool record_enable;		//是否启动本地录像
	int light_enable;		//是否启动照明
	int temperature;		//采集温度
	int alarm_flag;			//报警标志  0：无；1：手动；2：接近报警
	int frame_rate;			//视频帧率
	int bit_rate;			//视频码率
	int video_quality;		//视频质量，压缩率相关
	int sample_rate;		//音频采样率 0:8000,1:11025,2:22500,3:24000,4:44100,5:48000
};
#define STREAM_STATE_STOP   0
#define STREAM_STATE_RTMP   1
#define STREAM_STATE_RTP    2	

#define MSGCODE_HEARTBEAT_RTN 80300
#define MSGCOD_DOWN_EVENT	  90300

extern struct RUNTIME_STATE rt_data;

#endif